<template>
  <div v-if="$route.childrn == null && $route.meta.useFrame == true">
    <!--路由出口针对移动端-->
    <RouterView></RouterView>
  </div>
  <!--解决后台管理系统嵌套问题-->
  <div v-if="$route.meta.useFrame == undefined || $route.meta.useFrame == false">
    <el-container>
      <el-header>
        <el-row>
          <el-col :span="5">
            <img src="./assets/logo.jpg" alt="" width="200" height="40">
          </el-col>
          <el-col :span="17">
            <div style="font-size: 23px; text-align: center; line-height: 40px;">
              智能AI汽车服务管理平台
            </div>

          </el-col>
          <el-col :span="2">
            <el-dropdown>
              <span class="el-dropdown-link">
                唐三少
                <el-icon class="el-icon--right">
                  <arrow-down />
                </el-icon>
              </span>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item @click="onUser">个人中心</el-dropdown-item>
                  <el-dropdown-item>账户与安全</el-dropdown-item>
                  <el-dropdown-item>关于我们</el-dropdown-item>
                  <el-dropdown-item divided @click="onLogout">注销</el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
          </el-col>
        </el-row>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <!--引入组件-->
          <Menu></Menu>
        </el-aside>
        <el-main>
          <!--路由出口-->
          <RouterView></RouterView>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script setup>
import { RouterView } from 'vue-router';
import Menu from './components/Menu.vue';



const onUser = () => {
  console.log("用户中心")
}
const onLogout = () => { 
console.log("注销");

}
</script>
<style scoped>

.el-header{
  height: 40px;
  background-color: #98d7f3;
  padding-left: 0px;
}
.el-dropdown{
    line-height: 40px;
    padding-left: 10px;
}
.el-aside{
  background-color: #16a9fe;
  height: calc(100vh - 40px)
}
</style>
